package com.eight.common.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 课程
 * @TableName edu_chapter
 */
@Data
@ApiModel(value = "eduChapter表",description = "课时表")
@TableName("edu_chapter")
@EqualsAndHashCode(callSuper = false)
public class EduChapter implements Serializable {
    /**
     * 章节ID
     */
    @ApiModelProperty("章节ID")
    private String id;

    /**
     * 课程ID
     */
    @ApiModelProperty("课程ID")
    private String courseId;

    /**
     * 章节名称
     */
    @ApiModelProperty("章节名称")
    private String title;

    /**
     * 显示排序
     */
    @ApiModelProperty("显示排序")
    private Integer sort;

    /**
     * 创建时间
     */
    @ApiModelProperty("课程ID")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime gmtModified;

    private static final long serialVersionUID = 1L;


}